package com.flxz.forum.service.impl;

import java.util.List;
import com.flxz.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flxz.forum.mapper.ForumLikeMapper;
import com.flxz.forum.domain.ForumLike;
import com.flxz.forum.service.IForumLikeService;

/**
 * 讨论点赞Service业务层处理
 * 
 * @author fl
 * @date 2025-09-14
 */
@Service
public class ForumLikeServiceImpl implements IForumLikeService 
{
    @Autowired
    private ForumLikeMapper forumLikeMapper;

    /**
     * 查询讨论点赞
     * 
     * @param likeId 讨论点赞主键
     * @return 讨论点赞
     */
    @Override
    public ForumLike selectForumLikeByLikeId(Long likeId)
    {
        return forumLikeMapper.selectForumLikeByLikeId(likeId);
    }

    /**
     * 查询讨论点赞列表
     * 
     * @param forumLike 讨论点赞
     * @return 讨论点赞
     */
    @Override
    public List<ForumLike> selectForumLikeList(ForumLike forumLike)
    {
        return forumLikeMapper.selectForumLikeList(forumLike);
    }

    /**
     * 新增讨论点赞
     * 
     * @param forumLike 讨论点赞
     * @return 结果
     */
    @Override
    public int insertForumLike(ForumLike forumLike)
    {
        forumLike.setCreateTime(DateUtils.getNowDate());
        return forumLikeMapper.insertForumLike(forumLike);
    }

    /**
     * 修改讨论点赞
     * 
     * @param forumLike 讨论点赞
     * @return 结果
     */
    @Override
    public int updateForumLike(ForumLike forumLike)
    {
        return forumLikeMapper.updateForumLike(forumLike);
    }

    /**
     * 批量删除讨论点赞
     * 
     * @param likeIds 需要删除的讨论点赞主键
     * @return 结果
     */
    @Override
    public int deleteForumLikeByLikeIds(Long[] likeIds)
    {
        return forumLikeMapper.deleteForumLikeByLikeIds(likeIds);
    }

    /**
     * 删除讨论点赞信息
     * 
     * @param likeId 讨论点赞主键
     * @return 结果
     */
    @Override
    public int deleteForumLikeByLikeId(Long likeId)
    {
        return forumLikeMapper.deleteForumLikeByLikeId(likeId);
    }
}
